import { defineStore } from 'pinia'
import dialog, { DialogDataModel } from '@/api/dialog'

const initDialogData = (): DialogDataModel => {
    return {
        data:[]
    }
}

//弹框里的舞蹈类别
const useDialogStore = defineStore('dialog', {
    state() {
        return {
            dialogData: initDialogData(),
        }
    },
    actions: {
        async getDialogData() {
            try {
                let result = await dialog.getDialogData()
                this.dialogData = result
                console.log(result)
            } catch (error) {
                return Promise.reject(error)
            }
        },
    },
    getters: {},
})

export default useDialogStore
